webpackJsonp([1],{

/***/ 327:
/***/ (function(module, exports, __webpack_require__) {

var disposed = false
var normalizeComponent = __webpack_require__(8)
/* script */
var __vue_script__ = __webpack_require__(363)
/* template */
var __vue_template__ = __webpack_require__(364)
/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = null
/* scopeId */
var __vue_scopeId__ = null
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  __vue_script__,
  __vue_template__,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)
Component.options.__file = "resources\\assets\\js\\pages\\UserManage.vue"

/* hot reload */
if (false) {(function () {
  var hotAPI = require("vue-hot-reload-api")
  hotAPI.install(require("vue"), false)
  if (!hotAPI.compatible) return
  module.hot.accept()
  if (!module.hot.data) {
    hotAPI.createRecord("data-v-5a7630c7", Component.options)
  } else {
    hotAPI.reload("data-v-5a7630c7", Component.options)
  }
  module.hot.dispose(function (data) {
    disposed = true
  })
})()}

module.exports = Component.exports


/***/ }),

/***/ 330:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = {
  getPrintOut: function getPrintOut(id) {
    //打印页
    return axios.get('/api/print-info/' + id);
  },
  setlog: function setlog(id) {
    //打印页打印log
    return axios.get('/api/print-log/' + id);
  },
  getEnrollSituation: function getEnrollSituation() {
    //获取学校招生情况
    return axios.get('/api/situation-info');
  },
  getExportInfo: function getExportInfo(school_id) {
    //导出excl表
    return axios.get('/api/export/school_id=' + school_id);
  },
  postImportInfo: function postImportInfo(file) {
    //导入excl表
    return axios.post('/api/import', file, { headers: { 'Content-Type': 'multipart/form-data' } });
  },
  postSchoolUpperLimit: function postSchoolUpperLimit(id, upperLimit) {
    //重设幼儿园预计招生数
    return axios.post('/api/update-upper-limit/' + id, upperLimit);
  },
  getEnrollAll: function getEnrollAll(id) {
    //录取所有学生
    return axios.get('/api/all-enroll/' + id);
  },
  getStudentInfo: function getStudentInfo(id) {
    //录入页面
    return axios.get('/api/sign-up/' + id);
  },
  getPolice: function getPolice(id) {
    //录入页面根据幼儿园code获取派出所
    return axios.get('/api/police/' + id);
  },
  postStudent: function postStudent(model) {
    return axios.post('/api/sign-up/post', model);
  },
  putStudent: function putStudent(uuid, model) {
    return axios.put('/api/sign-up/' + uuid, model);
  },
  getUserInfo: function getUserInfo(id) {
    return axios.get('/api/user/' + id);
  },
  postUserInfo: function postUserInfo(model) {
    return axios.post('/api/user', model);
  },
  putUserInfo: function putUserInfo(uuid, model) {
    return axios.put('/api/user/' + uuid, model);
  },
  DeletedUserInfo: function DeletedUserInfo(uuid) {
    return axios.delete('/api/user/' + uuid);
  }
};

/***/ }),

/***/ 331:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


exports.__esModule = true;

var _isIterable2 = __webpack_require__(332);

var _isIterable3 = _interopRequireDefault(_isIterable2);

var _getIterator2 = __webpack_require__(335);

var _getIterator3 = _interopRequireDefault(_getIterator2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = function () {
  function sliceIterator(arr, i) {
    var _arr = [];
    var _n = true;
    var _d = false;
    var _e = undefined;

    try {
      for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {
        _arr.push(_s.value);

        if (i && _arr.length === i) break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"]) _i["return"]();
      } finally {
        if (_d) throw _e;
      }
    }

    return _arr;
  }

  return function (arr, i) {
    if (Array.isArray(arr)) {
      return arr;
    } else if ((0, _isIterable3.default)(Object(arr))) {
      return sliceIterator(arr, i);
    } else {
      throw new TypeError("Invalid attempt to destructure non-iterable instance");
    }
  };
}();

/***/ }),

/***/ 332:
/***/ (function(module, exports, __webpack_require__) {

module.exports = { "default": __webpack_require__(333), __esModule: true };

/***/ }),

/***/ 333:
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(71);
__webpack_require__(70);
module.exports = __webpack_require__(334);


/***/ }),

/***/ 334:
/***/ (function(module, exports, __webpack_require__) {

var classof = __webpack_require__(73);
var ITERATOR = __webpack_require__(5)('iterator');
var Iterators = __webpack_require__(27);
module.exports = __webpack_require__(7).isIterable = function (it) {
  var O = Object(it);
  return O[ITERATOR] !== undefined
    || '@@iterator' in O
    // eslint-disable-next-line no-prototype-builtins
    || Iterators.hasOwnProperty(classof(O));
};


/***/ }),

/***/ 335:
/***/ (function(module, exports, __webpack_require__) {

module.exports = { "default": __webpack_require__(336), __esModule: true };

/***/ }),

/***/ 336:
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(71);
__webpack_require__(70);
module.exports = __webpack_require__(337);


/***/ }),

/***/ 337:
/***/ (function(module, exports, __webpack_require__) {

var anObject = __webpack_require__(12);
var get = __webpack_require__(125);
module.exports = __webpack_require__(7).getIterator = function (it) {
  var iterFn = get(it);
  if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');
  return anObject(iterFn.call(it));
};


/***/ }),

/***/ 338:
/***/ (function(module, exports) {

module.exports = "/images/updateimg.png?fac069a6e6f9a976c2da02d0822d5d26";

/***/ }),

/***/ 339:
/***/ (function(module, exports) {

module.exports = "/images/deletedimg.png?d067a71dfc867b740bf12384b4767339";

/***/ }),

/***/ 363:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _slicedToArray2 = __webpack_require__(331);

var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);

var _promise = __webpack_require__(124);

var _promise2 = _interopRequireDefault(_promise);

var _ListDataSource = __webpack_require__(123);

var _ListDataSource2 = _interopRequireDefault(_ListDataSource);

var _data = __webpack_require__(330);

var _data2 = _interopRequireDefault(_data);

var _jsCookie = __webpack_require__(72);

var _jsCookie2 = _interopRequireDefault(_jsCookie);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = {
  data: function data() {
    return {
      tableList: new _ListDataSource2.default('/api/user'),
      queryModel: {},
      DialogVisible: false,
      model: {
        id: 0,
        name: '',
        username: '',
        type: 'admin',
        //            password: '',
        sex: '',
        school_id: ''
        //            api_token:''
        //            confirmPassword:''
      },
      ruleValidate: {
        name: [{ required: true, message: '此项目为必填项', trigger: 'blur' }],
        username: [{ required: true, message: '此项目为必填项', trigger: 'blur' }],
        type: [{ required: true, message: '此项目为必填项', trigger: 'blur' }],
        //          password: [
        //            {required: true, message: '此项目为必填项', trigger: 'blur'}
        //          ],
        //          confirmPassword: [
        //            {required: true, message: '此项目为必填项', trigger: 'blur'}
        //          ],
        sex: [{ required: true, message: '此项目为必填项', trigger: 'blur' }],
        school_id: [{ required: true, message: '此项目为必填项', trigger: 'blur' }]
      },
      schoolNameList: [{ name: '第一幼儿园', id: '101' }, { name: '第二幼儿园', id: '102' }, { name: '第四幼儿园', id: '104' }, { name: '模范幼儿园', id: '106' }, { name: '第三幼儿园', id: '103' }, { name: '第五幼儿园', id: '105' }],
      refreshList: false,
      editModelId: 0
    };
  },
  created: function created() {
    var vm = this;
    this.isLoading = true;
    _promise2.default.all([vm.tableList.fetchData()]).then(function (_ref) {
      var _ref2 = (0, _slicedToArray3.default)(_ref, 1),
          Response = _ref2[0];

      vm.isLoading = false;
    }).catch(function (error) {
      vm.isLoading = false;
    });
    console.log(vm.tableList);
  },

  methods: {
    goPage: function goPage(event) {
      var self = this;
      var query = _.assign({ page: event.page }, self.queryString);
      self.tableList.fetchData(query);
    },
    showDialog: function showDialog(id) {
      this.DialogVisible = true;
      this.editModelId = id;
      console.log(this.model);
    },
    closeDialog: function closeDialog() {
      this.DialogVisible = false;
      this.model = {
        id: 0,
        name: '',
        username: '',
        type: 'admin',
        sex: '',
        school_id: ''
      };
      this.editModelId = 0;
    },
    deletedUser: function deletedUser(id, type) {
      var self = this;
      if (type !== 'admin') {
        this.$confirm('此操作将永久删除该用户, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(function () {
          //            self.model.uuid = id
          //            self.model.destroy(function () {
          _data2.default.DeletedUserInfo(id).then(function (res) {
            self.$message.success('删除成功!');
            self.refreshList = !self.refreshList;
          });
        }).catch(function () {
          self.$message({
            type: 'info',
            message: '取消删除'
          });
        });
      } else {
        self.$message.error('不能删除管理员!');
      }
    },
    Dialogsave: function Dialogsave() {
      var self = this;
      console.log(self.model);
      self.$refs['model'].validate(function (valid) {
        if (valid) {
          console.log('表单验证通过');
          var uuid = self.model.id ? self.model.id : 0;
          if (uuid === 0) {
            _data2.default.postUserInfo(self.model).then(function (res) {
              self.$message.success(self.model.name + '保存成功');
              self.refreshList = !self.refreshList;
              self.closeDialog();
            }).catch(function (err) {
              self.$message.error('保存失败');
            });
          } else {
            _data2.default.putUserInfo(uuid, self.model).then(function (res) {
              self.$message.success(self.model.name + '修改成功');
              self.refreshList = !self.refreshList;
              self.closeDialog();
            }).catch(function (err) {
              self.$message.error('保存失败');
            });
          }
        } else {}
      });
    },
    logout: function logout() {
      axios.post('/api/logout', {}).then(function (response) {
        _jsCookie2.default.remove('user');
        window.location.reload();
      }).catch(function (error) {
        console.log(error);
      });
    },
    showSchool: function showSchool(school_id) {
      switch (school_id) {
        case '101':
          return '—第一幼儿园';
          break;
        case '102':
          return '—第二幼儿园';
          break;
        case '104':
          return '—第四幼儿园';
          break;
        case '106':
          return '—模范幼儿园';
          break;
        case '103':
          return '—第三幼儿园';
          break;
        case '105':
          return '—第五幼儿园';
          break;
        default:
          return '';
      }
    }
  },
  watch: {
    'editModelId': function editModelId(value) {
      var self = this;
      if (value != 0) {
        _data2.default.getUserInfo(value).then(function (res) {
          console.log(res);
          self.model = res.data.data;
        });
      }
      console.log(this.model);
    },
    'refreshList': function refreshList() {
      this.tableList.fetchData();
    }
  }
}; //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

/***/ }),

/***/ 364:
/***/ (function(module, exports, __webpack_require__) {

var render = function() {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c(
    "div",
    { staticClass: "all-list" },
    [
      _c(
        "el-card",
        { staticClass: "container mt-5" },
        [
          _c(
            "div",
            {
              staticClass: "clearfix",
              attrs: { slot: "header" },
              slot: "header"
            },
            [
              _c("span", [
                _c("span", { staticClass: "card-header-box" }),
                _vm._v("用户管理")
              ]),
              _vm._v(" "),
              _c(
                "a",
                {
                  staticClass: "list-button float-right p-1",
                  attrs: { href: "javascript:;" },
                  on: { click: _vm.logout }
                },
                [_vm._v("登出")]
              ),
              _vm._v(" "),
              _c(
                "a",
                {
                  staticClass: "list-button float-right p-1 mr-3",
                  attrs: { href: "javascript:;" },
                  on: {
                    click: function($event) {
                      _vm.showDialog(0)
                    }
                  }
                },
                [_vm._v("添加")]
              )
            ]
          ),
          _vm._v(" "),
          _c(
            "vue-table",
            {
              attrs: {
                "data-source": _vm.tableList,
                queryString: _vm.queryModel
              },
              scopedSlots: _vm._u([
                {
                  key: "tbody",
                  fn: function(props) {
                    return [
                      _c(
                        "tr",
                        { class: props.index % 2 == 0 ? "table-row" : "" },
                        [
                          _c("td", [_vm._v(_vm._s(props.item.name))]),
                          _vm._v(" "),
                          _c("td", [_vm._v(_vm._s(props.item.username))]),
                          _vm._v(" "),
                          _c("td", [
                            _vm._v(
                              _vm._s(props.item.type) +
                                _vm._s(_vm.showSchool(props.item.school_id))
                            )
                          ]),
                          _vm._v(" "),
                          _c(
                            "td",
                            [
                              _c(
                                "el-tooltip",
                                {
                                  staticClass: "mr-3",
                                  attrs: { content: "修改", placement: "top" }
                                },
                                [
                                  _c("img", {
                                    attrs: {
                                      src: __webpack_require__(338),
                                      height: "17",
                                      width: "17"
                                    },
                                    on: {
                                      click: function($event) {
                                        _vm.showDialog(props.item.id)
                                      }
                                    }
                                  })
                                ]
                              ),
                              _vm._v(" "),
                              _c(
                                "el-tooltip",
                                {
                                  attrs: { content: "删除", placement: "top" }
                                },
                                [
                                  _c("img", {
                                    attrs: {
                                      src: __webpack_require__(339),
                                      height: "17",
                                      width: "17"
                                    },
                                    on: {
                                      click: function($event) {
                                        _vm.deletedUser(
                                          props.item.id,
                                          props.item.type
                                        )
                                      }
                                    }
                                  })
                                ]
                              )
                            ],
                            1
                          )
                        ]
                      )
                    ]
                  }
                }
              ])
            },
            [
              _c("template", { slot: "header" }, [
                _c("tr", [
                  _c("th", { attrs: { scope: "col" } }, [_vm._v("姓名")]),
                  _vm._v(" "),
                  _c("th", { attrs: { scope: "col" } }, [_vm._v("用户名")]),
                  _vm._v(" "),
                  _c("th", { attrs: { scope: "col" } }, [_vm._v("权限")]),
                  _vm._v(" "),
                  _c("th", { attrs: { scope: "col" } }, [_vm._v("操作")])
                ])
              ])
            ],
            2
          )
        ],
        1
      ),
      _vm._v(" "),
      _c(
        "div",
        { staticClass: " mt-5" },
        [
          _c("cplanet-pagination", {
            attrs: {
              "page-count": _vm.tableList.meta.last_page,
              total: _vm.tableList.meta.total,
              "current-page": _vm.tableList.meta.current_page
            },
            on: { goPage: _vm.goPage }
          })
        ],
        1
      ),
      _vm._v(" "),
      _c(
        "el-dialog",
        {
          attrs: {
            title: _vm.editModelId == 0 ? "新增用户信息" : "修改用户信息",
            visible: _vm.DialogVisible,
            width: "60%",
            center: ""
          },
          on: {
            "update:visible": function($event) {
              _vm.DialogVisible = $event
            }
          }
        },
        [
          _c(
            "span",
            [
              _c(
                "el-form",
                {
                  ref: "model",
                  staticStyle: { width: "100%" },
                  attrs: {
                    model: _vm.model,
                    rules: _vm.ruleValidate,
                    "label-width": "85px"
                  }
                },
                [
                  _c(
                    "el-col",
                    { attrs: { span: 10 } },
                    [
                      _c(
                        "el-form-item",
                        {
                          staticClass: "mb-3",
                          attrs: { label: "姓名: ", prop: "name" }
                        },
                        [
                          _c("el-input", {
                            attrs: { placeholder: "请输入姓名" },
                            model: {
                              value: _vm.model.name,
                              callback: function($$v) {
                                _vm.$set(_vm.model, "name", $$v)
                              },
                              expression: "model.name"
                            }
                          })
                        ],
                        1
                      )
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _c(
                    "el-col",
                    { attrs: { span: 10, offset: 2 } },
                    [
                      _c(
                        "el-form-item",
                        {
                          staticClass: "mb-3",
                          attrs: { label: "用户名: ", prop: "username" }
                        },
                        [
                          _c("el-input", {
                            attrs: { placeholder: "请输入用户名" },
                            model: {
                              value: _vm.model.username,
                              callback: function($$v) {
                                _vm.$set(_vm.model, "username", $$v)
                              },
                              expression: "model.username"
                            }
                          })
                        ],
                        1
                      )
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _c(
                    "el-col",
                    { attrs: { span: 10 } },
                    [
                      _c(
                        "el-form-item",
                        {
                          staticClass: "mb-3",
                          attrs: { label: "密码: ", prop: "password" }
                        },
                        [
                          _c("el-input", {
                            attrs: { placeholder: "请输入密码" },
                            model: {
                              value: _vm.model.password,
                              callback: function($$v) {
                                _vm.$set(_vm.model, "password", $$v)
                              },
                              expression: "model.password"
                            }
                          })
                        ],
                        1
                      )
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _c(
                    "el-col",
                    { attrs: { span: 10, offset: 2 } },
                    [
                      _c(
                        "el-form-item",
                        {
                          staticClass: "mb-3",
                          attrs: { label: "性别: ", prop: "sex" }
                        },
                        [
                          _c(
                            "el-radio",
                            {
                              staticClass: "mt-2",
                              attrs: { label: "男" },
                              model: {
                                value: _vm.model.sex,
                                callback: function($$v) {
                                  _vm.$set(_vm.model, "sex", $$v)
                                },
                                expression: "model.sex"
                              }
                            },
                            [_vm._v("男")]
                          ),
                          _vm._v(" "),
                          _c(
                            "el-radio",
                            {
                              staticClass: "mt-2",
                              attrs: { label: "女" },
                              model: {
                                value: _vm.model.sex,
                                callback: function($$v) {
                                  _vm.$set(_vm.model, "sex", $$v)
                                },
                                expression: "model.sex"
                              }
                            },
                            [_vm._v("女")]
                          )
                        ],
                        1
                      )
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _c(
                    "el-col",
                    { attrs: { span: 10 } },
                    [
                      _c(
                        "el-form-item",
                        {
                          staticClass: "mb-3",
                          attrs: { label: "身份: ", prop: "type" }
                        },
                        [
                          _c(
                            "el-radio",
                            {
                              staticClass: "mt-2",
                              attrs: { label: "admin" },
                              model: {
                                value: _vm.model.type,
                                callback: function($$v) {
                                  _vm.$set(_vm.model, "type", $$v)
                                },
                                expression: "model.type"
                              }
                            },
                            [_vm._v("admin")]
                          ),
                          _vm._v(" "),
                          _c(
                            "el-radio",
                            {
                              staticClass: "mt-2",
                              attrs: { label: "录入" },
                              model: {
                                value: _vm.model.type,
                                callback: function($$v) {
                                  _vm.$set(_vm.model, "type", $$v)
                                },
                                expression: "model.type"
                              }
                            },
                            [_vm._v("录入")]
                          ),
                          _vm._v(" "),
                          _c(
                            "el-radio",
                            {
                              staticClass: "mt-2",
                              attrs: { label: "编辑" },
                              model: {
                                value: _vm.model.type,
                                callback: function($$v) {
                                  _vm.$set(_vm.model, "type", $$v)
                                },
                                expression: "model.type"
                              }
                            },
                            [_vm._v("编辑")]
                          )
                        ],
                        1
                      )
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _vm.model.type !== "admin"
                    ? _c(
                        "el-col",
                        { attrs: { span: 10, offset: 2 } },
                        [
                          _c(
                            "el-form-item",
                            {
                              staticClass: "mb-3 all-select",
                              attrs: { label: "学校: ", prop: "school_id" }
                            },
                            [
                              _c(
                                "el-select",
                                {
                                  staticStyle: { width: "100%" },
                                  attrs: {
                                    placeholder: "请选择学校",
                                    clearable: ""
                                  },
                                  model: {
                                    value: _vm.model.school_id,
                                    callback: function($$v) {
                                      _vm.$set(_vm.model, "school_id", $$v)
                                    },
                                    expression: "model.school_id"
                                  }
                                },
                                _vm._l(_vm.schoolNameList, function(item) {
                                  return _c("el-option", {
                                    key: item.id,
                                    attrs: { label: item.name, value: item.id }
                                  })
                                })
                              )
                            ],
                            1
                          )
                        ],
                        1
                      )
                    : _c(
                        "el-col",
                        {
                          staticStyle: { height: "64px" },
                          attrs: { span: 10, offset: 2 }
                        },
                        [
                          _c("el-form-item", {
                            staticClass: "mb-3",
                            attrs: { label: " " }
                          })
                        ],
                        1
                      )
                ],
                1
              )
            ],
            1
          ),
          _vm._v(" "),
          _c(
            "span",
            {
              staticClass: "dialog-footer",
              staticStyle: { position: "relative", bottom: "0" },
              attrs: { slot: "footer" },
              slot: "footer"
            },
            [
              _c("el-button", { on: { click: _vm.closeDialog } }, [
                _vm._v("取 消")
              ]),
              _vm._v(" "),
              _c(
                "el-button",
                { attrs: { type: "primary" }, on: { click: _vm.Dialogsave } },
                [_vm._v("确 定")]
              )
            ],
            1
          )
        ]
      )
    ],
    1
  )
}
var staticRenderFns = []
render._withStripped = true
module.exports = { render: render, staticRenderFns: staticRenderFns }
if (false) {
  module.hot.accept()
  if (module.hot.data) {
    require("vue-hot-reload-api")      .rerender("data-v-5a7630c7", module.exports)
  }
}

/***/ })

});